@(account: gitbucket.core.model.Account, groupNames: List[String], active: String, extraMailAddresses: List[String],
  isGroupManager: Boolean = false)(body: Html)(implicit context: gitbucket.core.controller.Context)
@import gitbucket.core.view.helpers
@gitbucket.core.html.main(account.userName){
  <div class="main-sidebar">
    <div class="sidebar">
      <div class="user-panel">
        <div class="pull-left image">@helpers.avatar(account.userName, 40)</div>
        <div class="pull-left info">
          <p>@account.userName</p>
          @account.fullName
        </div>
      </div>
      <div style="padding-left: 10px; padding-right: 10px;">
        @account.description.map { description =>
          <p style="color: #999">@description</p>
        }
        @account.url.map { url =>
          <p style="white-space: nowrap; overflow: hidden; text-overflow: ellipsis;">
            <i class="octicon octicon-home"></i>
            @if(url.startsWith("http://") || url.startsWith("https://")){
              <a href="@url">@url</a>
            } else {
            <span style="color: #999">@url</span>
            }
          </p>
        }
        @if(context.settings.showMailAddress){
          <p style="white-space: nowrap; overflow: hidden; text-overflow: ellipsis;">
            <i class="octicon octicon-mail"></i> <a href="mailto:@account.mailAddress">@account.mailAddress</a>
          </p>
          @extraMailAddresses.map { mail =>
            <p style="white-space: nowrap; overflow: hidden; text-overflow: ellipsis;">
              <i class="octicon octicon-mail"></i> <a href="mailto:@mail">@mail</a>
            </p>
          }
        }
        <p style="color: #999">
          <i class="octicon octicon-clock"></i> Joined on @helpers.date(account.registeredDate)
        </p>
      </div>
      @if(groupNames.nonEmpty){
        <ul class="sidebar-menu">
          <li class="header">Groups</li>
          @groupNames.map { groupName =>
            <li>@helpers.avatarLink(groupName, 20, tooltip = true, label = true)</li>
          }
        </ul>
      }
    </div>
  </div>
  <div class="content-wrapper">
    <div class="content body">
      <ul class="nav nav-tabs" style="margin-bottom: 5px;">
        <li@if(active == "repositories"){ class="active"}><a href="@helpers.url(account.userName)?tab=repositories">Repositories</a></li>
        @if(account.isGroupAccount){
          <li@if(active == "members"){ class="active"}><a href="@helpers.url(account.userName)?tab=members">Members</a></li>
        } else {
          <li@if(active == "activity"){ class="active"}><a href="@helpers.url(account.userName)?tab=activity">Public activity</a></li>
        }
        @*
        <li@if(active == "webhooks"){ class="active"}><a href="@helpers.url(account.userName)?tab=webhooks">Webhooks</a></li>
        *@
        @gitbucket.core.plugin.PluginRegistry().getProfileTabs.map { tab =>
          @tab(account, context).map { link =>
            <li@if(active == link.id){ class="active"}><a href="@context.path/@link.path">@link.label</a></li>
          }
        }
        @if(context.loginAccount.isDefined && context.loginAccount.get.userName == account.userName){
          <li class="pull-right">
            <div class="button-group">
              <a href="@helpers.url(account.userName)/_edit" class="btn btn-default">Edit your profile</a>
            </div>
          </li>
        }
        @if(context.loginAccount.isDefined && account.isGroupAccount && isGroupManager){
          <li class="pull-right">
            <div class="button-group">
              <a href="@helpers.url(account.userName)/_editgroup" class="btn btn-default">Edit group</a>
            </div>
          </li>
        }
      </ul>
      @body
    </div>
  </div>
}
